package com.haixue.android.academy.activity;

import android.content.Intent;
import android.view.View;

import com.haixue.android.academy.utils.IntentUtils;

/**
 * Created by ren on 2015/6/4 0004.
 */
public abstract class BaseSelectCategoryActivity extends  BaseTitleBarActivity {

    @Override
    public void onSelectCategoryClick(View view) {
        super.onSelectCategoryClick(view);
        Intent intent = new Intent(getActivity(), SelectCategoryActivity.class);
        intent.putExtra("data",userWapper);
        IntentUtils.toActivityFoResult(getActivity(), intent);
        getActivity().overridePendingTransition(0, 0);
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (requestCode == IntentUtils.DEFAULT_REQUEST_CODE && data!=null){
            onRefreshData(data.getLongExtra("data",-1));
        }
    }

    protected void onRefreshData(long data){}
}
